<?php

/**
 * Commentaire form base class.
 *
 * @package    TC5
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 12815 2008-11-09 10:43:58Z fabien $
 */
class BaseCommentaireForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'          => new sfWidgetFormInputHidden(),
      'personne_id' => new sfWidgetFormPropelChoice(array('model' => 'Personne', 'add_empty' => true)),
      'produit_id'  => new sfWidgetFormPropelChoice(array('model' => 'Produit', 'add_empty' => true)),
      'note'        => new sfWidgetFormInput(),
      'commentaire' => new sfWidgetFormTextarea(),
    ));

    $this->setValidators(array(
      'id'          => new sfValidatorPropelChoice(array('model' => 'Commentaire', 'column' => 'id', 'required' => false)),
      'personne_id' => new sfValidatorPropelChoice(array('model' => 'Personne', 'column' => 'id', 'required' => false)),
      'produit_id'  => new sfValidatorPropelChoice(array('model' => 'Produit', 'column' => 'id', 'required' => false)),
      'note'        => new sfValidatorInteger(array('required' => false)),
      'commentaire' => new sfValidatorString(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('commentaire[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Commentaire';
  }


}
